Skip to content

Add full navigation section type support (Tabs, Anchors, Dropdowns, Products)#49

Merged
robertmclaws merged 4 commits intomainfrom
dev
Feb 28, 2026
Merged

Add full navigation section type support (Tabs, Anchors, Dropdowns, Products)#49
robertmclaws merged 4 commits intomainfrom
dev

Conversation

@robertmclaws
Copy link
Contributor

@robertmclaws robertmclaws commented Feb 28, 2026

Summary

  • Parse all four Mintlify navigation section types from <MintlifyTemplate> XML — ParseNavigationConfig previously only handled <Pages>; Tabs, Anchors, Dropdowns, and Products were silently ignored
  • Add ParseTabConfig, ParseAnchorConfig, ParseDropdownConfig, ParseProductConfig internal methods with full attribute and nested-element support (Tabs-within-Anchors, Tabs+Anchors-within-Dropdowns, etc.)
  • Add ParseNavigationSectionPages private helper to share <Groups>/<Group> and <Page> parsing logic across all section types
  • Fix spurious navigation.pages output when template uses explicit sectionsMintlifyRenderer was still calling PopulateNavigationFromPath and BuildNavigationStructure even when the template fully specified navigation via Tabs/Anchors/Dropdowns/Products, producing a broken docs.json with both pages and tabs blocks
  • Add 20 parser-layer tests in GenerateDocumentationTaskTests.cs covering all new Parse*Config methods, HTML entity decoding, nested structures, multi-type coexistence, and backward-compatible Pages behavior
  • Add 4 renderer-level integration tests in MintlifyRendererNavigationTypeTests.cs that exercise the full ProcessAsyncRenderAsyncDocsJsonManager.Save round-trip and assert Navigation.Pages is null — including a regression test with a real assembly present
  • Bump DotNetDocs.Sdk reference from 1.2.0 to 1.3.0 in both .docsproj files
  • Fix EasyAF.MSBuild version constraint from 4.*-* to 4.* to resolve pre-existing NU1107 dependency conflict
  • Reorganize specs — move semantic-kernel-integration.md and try-dotnet.md into specs/future/

Test plan

  • All existing ParseGroupConfig, ApplyNavigationType, and navigation tests continue to pass (318 SDK Tasks + 249 Mintlify = 567 total, 0 failures)
  • ParseTabConfig_WithHtmlEncodedName_DecodesCorrectlyS&amp;S decoded to S&S
  • ParseTabConfig_WithNestedGroups_ParsesHierarchy — nested GroupConfig within Tab
  • ParseAnchorConfig_WithNestedTabs_ParsesTabs — Tabs nested within Anchor
  • ParseDropdownConfig_WithNestedTabsAndAnchors_ParsesBoth — Tabs + Anchors within Dropdown
  • ParseNavigationConfig_WithTabsElement_PopulatesTabsNotPages — Pages remains null when Tabs used
  • ParseNavigationConfig_WithTabsElement_PreservesTabOrder — 5-tab order preserved including &amp; entities
  • ParseNavigationConfig_WithPagesElement_StillWorks — backward compatibility maintained
  • ExplicitTemplateTabs_ContentOnly_HasTabsAndNoPages — content-only mode produces no spurious pages block
  • ExplicitTemplateTabs_WithAssembly_HasOnlyTabsAndNoPages — regression: assembly present does not inject pages
  • ExplicitTemplateAnchors_ContentOnly_HasAnchorsAndNoPages
  • ExplicitTemplateProducts_ContentOnly_HasProductsAndNoPages

🤖 Generated with Claude Code

robertmclaws and others added 4 commits February 27, 2026 18:41
ParseNavigationConfig previously only handled Pages-based navigation,
always initializing an empty Pages list even when unused. This adds
support for all four remaining Mintlify navigation section types:
Tabs, Anchors, Dropdowns, and Products.

Changes:
- Rework ParseNavigationConfig to detect and populate Tabs, Anchors,
  Dropdowns, and Products from their XML wrapper elements; Pages
  initialization is now deferred and only set when explicitly present
- Add ParseTabConfig, ParseAnchorConfig, ParseDropdownConfig, and
  ParseProductConfig internal methods with full XML attribute and
  nested-element parsing
- Add ParseNavigationSectionPages private helper to share
  Groups/Page parsing logic across all section types
- Add 20 new tests covering all parse methods, HTML entity decoding,
  nested structures, multi-type coexistence, and backward compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e specs to future

- Bump DotNetDocs.Sdk reference from 1.2.0 to 1.3.0 in both .docsproj files
- Change EasyAF.MSBuild version constraint from 4.*-* to 4.* to resolve NU1107 conflict
- Delete specs/semantic-kernel-integration.md and specs/try-dotnet.md (moved to specs/future/)
- Add specs/future/ with moved specs and contributors.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a MintlifyTemplate specifies Tabs, Anchors, Dropdowns, or Products
directly in the <Navigation> XML, the renderer was still calling
PopulateNavigationFromPath which unconditionally initialized Pages and
auto-discovered MDX files from disk. This produced a spurious
"navigation.pages" block alongside the explicit "navigation.tabs" in the
output docs.json.

Fix by checking for explicit navigation sections after loading the
template config and skipping both PopulateNavigationFromPath and
BuildNavigationStructure when they are present. The NavigationType-based
auto-generation path (where Pages are discovered then moved to a Tab by
ApplyNavigationType) is unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The parser-layer tests (ParseNavigationConfig_WithTabsElement_PopulatesTabsNotPages
etc.) already verified that Pages comes back null when only Tabs are
defined in XML. However, the actual bug was one layer deeper — in
MintlifyRenderer.ProcessAsync, which called PopulateNavigationFromPath
and injected a spurious pages block regardless.

This adds:
- contentOnly parameter to ConfigureTestWithTemplate so tests can invoke
  ProcessAsync([]) (documentation-only mode) with HasMintlifyTemplate set
- ExplicitTemplateTabs_ContentOnly_HasTabsAndNoPages
- ExplicitTemplateTabs_WithAssembly_HasOnlyTabsAndNoPages (regression)
- ExplicitTemplateAnchors_ContentOnly_HasAnchorsAndNoPages
- ExplicitTemplateProducts_ContentOnly_HasProductsAndNoPages

Each test asserts that Navigation.Pages is null in the deserialized
docs.json when the template defines an explicit navigation section type,
which is the behavior introduced by the MintlifyRenderer fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@robertmclaws robertmclaws merged commit 42e5679 into main Feb 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant